package com.vhall.component.controller.ctrl.facade;

import com.alibaba.fastjson.JSONObject;
import com.vhall.component.entity.ctrl.AnchorExtendsEntityDTO;
import com.vhall.component.entity.ctrl.vo.ConnectNumSetReqVo;
import com.vhall.component.entity.ctrl.vo.ConnectNumVo;
import com.vhall.component.entity.ctrl.vo.ConnectQueueAddReqVo;
import com.vhall.component.entity.ctrl.vo.GetConnectNumRspVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * 并发控制组件 - Admin 端接口
 *
 * @author xuyongzheng
 * @link https://factory.vhallyun.com/fe/document/be/use/%E5%B9%B6%E5%8F%91%E6%8E%A7%E5%88%B6.html
 * @since 2021/5/17 上午11:12
 **/
@FeignClient(value = "CtrlAdmFacade", path = "/v4/ctrl/admin")
public interface CtrlAdmFacade {

    /**
     * 设置并发总数
     *
     * @param vo 参数
     * @return 返回值
     */
    @PostMapping("/set-connect-num")
    AnchorExtendsEntityDTO setConnectNum(@Validated ConnectNumSetReqVo vo);

    /**
     * 获得并发总数
     *
     * @param vo 参数
     * @return 返回值
     */
    @PostMapping("/get-connect-num")
    GetConnectNumRspVO getConnectNum(@Validated ConnectNumVo vo);

    /**
     * 用户加入排队队列
     *
     * @param vo 参数
     * @return 返回值
     */
    @PostMapping("/queue-add")
    Boolean queueAdd(@Validated ConnectQueueAddReqVo vo);

    /**
     * 获取系统下的当前连接数
     *
     * @return
     */
    @GetMapping("/getSysConnectInfo")
    JSONObject getSysConnectInfo();
}
